home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
dev
/
c
/
AmiVoGL_MDEV.lha
/
src
/
scale.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-04-12
|
934b
|
54 lines
#include "vogl.h"
/*
* scale
*
* Set up a scale matrix and premultiply it and
* the top matrix on the stack.
*
*/
void scale(
float x,
float y,
float z)
{
Token *tok;
if (!vdevice.initialised)
verror("scale: vogl not initialised");
if (vdevice.inobject) {
tok = newtokens(4);
tok[0].i = SCALE;
tok[1].f = x;
tok[2].f = y;
tok[3].f = z;
return;
}
/*
* Do the operations directly on the top matrix of
* the stack to speed things up.
*/
vdevice.transmat->m[0][0] *= x;
vdevice.transmat->m[0][1] *= x;
vdevice.transmat->m[0][2] *= x;
vdevice.transmat->m[0][3] *= x;
vdevice.transmat->m[1][0] *= y;
vdevice.transmat->m[1][1] *= y;
vdevice.transmat->m[1][2] *= y;
vdevice.transmat->m[1][3] *= y;
vdevice.transmat->m[2][0] *= z;
vdevice.transmat->m[2][1] *= z;
vdevice.transmat->m[2][2] *= z;
vdevice.transmat->m[2][3] *= z;
}
/* ------------------------------------------------------------------------ */